/*
 * @Author: dctxf
 * @Date:   2017-12-14 10:39:06
 * @Last Modified by:   dctxf
 * @Last Modified time: 2017-12-14 11:17:32
 */

module.exports = function flat(arr) {
  return arr.reduce((prev, next) => {
    return prev.concat(Array.isArray(next) ? flat(next) : next)
  }, [])
}